import {MAPPINGLIST, MAPPINGPAGELIST, SAVEMAPPING, ADDNEWHOTEL, CANCELMAPPING, ROOMMAPPINGLIST, UNROOMMAPPINGLIST, SAVEROOMMAPPINGS, CANCELROOMMAPPING} from '@/services/api'
import {request, METHOD} from '@/utils/request'

/**
 * 获取匹配列表
 */
export async function getMappingPageList(pageIndex, pageSize, params) {
    params.pageIndex = pageIndex
    params.pageSize = pageSize
    return request(MAPPINGPAGELIST, METHOD.POST, params)
}

/**
 * 获取匹配列表
 */
export async function getMappingList(hotelId) {
    return request(MAPPINGLIST, METHOD.GET, {hotelId: hotelId})
}

/**
 * 保存匹配
 * @param params
 * @returns {Promise<*>}
 */
export async function saveMapping(params) {
    return request(SAVEMAPPING, METHOD.GET, params)
}

/**
 * 添加新酒店
 * @param params
 * @returns {Promise<*>}
 */
export async function addNewHotel(params) {
    return request(ADDNEWHOTEL, METHOD.GET, params)
}

/**
 * 取消匹配
 * @param params
 * @returns {Promise<*>}
 */
export async function cancelMapping(params) {
    return request(CANCELMAPPING, METHOD.GET, params)
}

/**
 * 获取房型匹配列表
 */
export async function getRoomMappingList(hotelId) {
    return request(ROOMMAPPINGLIST, METHOD.GET, {hotelId: hotelId})
}

/**
 * 获取未匹配房型列表
 */
export async function getUnMappingRooms(hotelId) {
    return request(UNROOMMAPPINGLIST, METHOD.GET, {hotelId: hotelId})
}

/**
 * 保存房型匹配
 * @param params
 * @returns {Promise<*>}
 */
export async function saveRoomMappings(params) {
    return request(SAVEROOMMAPPINGS, METHOD.POST, params)
}

/**
 * 取消房型匹配
 * @param params
 * @returns {Promise<*>}
 */
export async function cancelRoomMapping(params) {
    return request(CANCELROOMMAPPING, METHOD.GET, params)
}
